package com.diy.sigmund.diycommon.test.controller.other;

import com.diy.sigmund.diycommon.entity.ResultMsg;
import com.diy.sigmund.diycommon.entity.base.exception.DiyRuntimeException;
import com.diy.sigmund.diycommon.test.config.entity.ImportPerson;
import com.diy.sigmund.diycommon.util.json.JacksonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ylm-sigmund
 * @since 2021/10/23 19:41
 */
@RestController
public class ImportTestConfigController {

    @Autowired
    private ImportPerson importPerson;

    @GetMapping("/common/importTestConfigController/test")
    public ResultMsg test() {
        System.out.println(importPerson);
        importPerson.setName("小明");
        System.out.println(JacksonUtil.toJson(importPerson));
        if (true) {
            throw new DiyRuntimeException("333");
        }
        return ResultMsg.success("test");
    }
}
